#pragma once


#include <SDL/SDL_thread.h>
#include "VProcessor.h"

class VBackgroundWorker :
    public VProcessor
{

public:
    VBackgroundWorker(void);
    virtual ~VBackgroundWorker(void);

public: // static member
    static unsigned int currentThreadId();


public: // properties
    virtual void setCallback(thread_callback_t callback);
    virtual thread_callback_t getCallback(void) const;

public: // control interfaces
    virtual bool start(void* data = NULL);
    virtual void terminate();
    virtual int join();
    virtual unsigned int threadId() const;

protected:
    thread_callback_t _callback;
    SDL_Thread* _thread;
    bool _started;
};
